<?php

namespace App\Providers;

use App\Models\Post;
use Illuminate\Support\ServiceProvider;
use DB;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {

        /*DB::listen(function($sql, $bindings, $time) {
            echo 'SQL语句执行：'.$sql.'，参数：'.json_encode($bindings).',耗时：'.$time.'ms';
        });*/
/*        Post::saving(function($post){
            echo 'saving event is fired<br>';
        });

        Post::creating(function($post){
            echo 'creating event is fired<br>';
        });

        Post::created(function($post){
            echo 'created event is fired<br>';
        });

        Post::created(function($post){
            echo 'saved event is fired<br>';
        });*/
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
